<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <template v-for="item in data">
      <component v-if="item.display" :key="item.moduleName" :is="MODULES_MAP[item.moduleName]" />
    </template>
  </div>
</template>

<script>
import registerModules from '@/mixins/registerModules'
import { MODULES_MAP } from '@/constants/componentsMap'
export default {
  name: 'App',
  mixins: [registerModules],
  data() {
    return {
      data: [],
      MODULES_MAP,
    }
  },
  created() {
    setTimeout(() => {
      this.data = [
        {
          display: true,
          moduleName: 'SERVER_FOO'
        },
        {
          display: false,
          moduleName: 'SERVER_HELLO_WORLD'
        },
      ]
    }, 2000)
  },
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
